package ngames.com.sushitv.temp.Module;

import android.os.Handler;


import java.util.List;

import ngames.com.sushitv.entity.Tag;

/**
 * Created by edmond on 16-8-1.
 */
public class TagFractory {

    public void initData(final List<Tag> data, final Handler handler){
        new Thread(){
            @Override
            public void run() {
                super.run();
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

                data.add(new Tag());
                data.add(new Tag());
                data.add(new Tag());
                data.add(new Tag());
                data.add(new Tag());

                handler.sendEmptyMessage(0);
            }
        }.start();
    }

    public void refreshData(final List<Tag> data, final Handler handler){
        new Thread(){
            @Override
            public void run() {
                super.run();
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

                data.add(new Tag());
                data.add(new Tag());
                data.add(new Tag());
                data.add(new Tag());
                data.add(new Tag());

                handler.sendEmptyMessage(2);
            }
        }.start();
    }

    public void moreData(final List<Tag> data, final Handler handler){
        new Thread(){
            @Override
            public void run() {
                super.run();
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

                data.add(new Tag());
                data.add(new Tag());
                data.add(new Tag());
                data.add(new Tag());
                data.add(new Tag());

                handler.sendEmptyMessage(1);
            }
        }.start();
    }
}
